package cn.yonyong.base.project.controller;

import cn.yonyong.base.project.service.UserAppearService;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Describtion Todo
 * @Author yonyong
 * @Date 2019/9/16 14:53
 * @Version 1.0.0
 **/
@Api(value = "/export", tags = "报表导出")
@RestController
@RequestMapping("export")
public class ExportExcelController {

    @Resource
    private UserAppearService userAppearService;

    @ApiOperation(value = "导出批次明细报表（导出前十条）")
    @RequestMapping(value = "excel", method = RequestMethod.GET, produces = "application/json;utf-8")
    public JSONObject export(HttpServletRequest request, HttpServletResponse response){
        return userAppearService.exportExcel(request,response);
    }
}
